overall logic

總邏輯